function qhForm() {

    let loginTab = document.getElementById('login_tab');
    let regTab = document.getElementById('reg_tab');
    let loginForm = document.getElementById('login_form');
    let regForm = document.getElementById('reg_form');

    loginTab.addEventListener('click', function (e) {
        e.preventDefault();
        if (!this.classList.contains('active')) {
            regForm.style.animation = 'slideOutRight 0.3s forwards';
            setTimeout(() => {
                regForm.style.display = 'none';
                loginForm.style.display = 'block';
                loginForm.style.animation = 'slideInLeft 0.3s forwards';
            }, 300);
            this.classList.add('active');
            regTab.classList.remove('active');
        }
    });

    regTab.addEventListener('click', function (e) {
        e.preventDefault();
        if (!this.classList.contains('active')) {
            loginForm.style.animation = 'slideOutLeft 0.3s forwards';
            setTimeout(() => {
                loginForm.style.display = 'none';
                regForm.style.display = 'block';
                regForm.style.animation = 'slideInRight 0.3s forwards';
            }, 300);
            this.classList.add('active');
            loginTab.classList.remove('active');
        }
    });
}
qhForm();